<template>
  <div class="form-item">
    <label v-if="label" class="text_color">{{labelText}}</label>
    <div class="form-body" :class="{ 'active' : active }">
      <van-field v-model="username" @focus="active=true" @blur="active=false" :error="error" placeholder="请输入用户名" />
    </div>
  </div>
</template>
<script>
export default {
  name: "Username",
  props: {
    label: {
      type: Boolean,
      default: false
    },
    labelText: {
      type: String,
      default: "请输入手机号"
    }
  },
  data() {
    return {
      username: "",
      error: false,
      active: false
    };
  },
  methods: {},
};
</script>
<style lang="scss" scoped>
.text_color {
  color: #fff;
}
</style>